shortcuts window: Fix handling of significant xml chars
authorMatthias Clasen <mclasen@redhat.com>
Sun, 19 Jun 2016 21:49:03 +0000 (17:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 19 Jun 2016 21:49:03 +0000 (17:49 -0400)
We are using markup in the labels, so we need to escape things
like < and >.

https://bugzilla.gnome.org/show_bug.cgi?id=767795

gtk/gtkshortcutlabel.c

index a62641a9204f28189423165849a5f1b2a963625a..06b173662e5b28616d006bc3a03c292caa8dfad8 100644 (file)
@@ -150,6 +150,21 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
     {
       switch (ch)
         {
+        case '<':
+          labels[i++] = "&lt;";
+          break;
+        case '>':
+          labels[i++] = "&gt;";
+          break;
+        case '&':
+          labels[i++] = "&amp;";
+          break;
+        case '"':
+          labels[i++] = "&quot;";
+          break;
+        case '\'':
+          labels[i++] = "&apos;";
+          break;
         case '\\':
           labels[i++] = C_("keyboard label", "Backslash");
           break;